Electrical converter consisting of a synchronous machine that converts alternating to direct current or vice versa